package kr.co.redcircle.service.oAuth.internal;

import java.util.Collection;
import java.util.Enumeration;
import java.util.Hashtable;

public class InternalDataManager {
	
	public static int POST_THREAD = 0;
	public static int GET_USER_INFORMATION = 1;
	
	private Hashtable<Integer, IProcessor> internalProcessorCollection = new Hashtable<Integer, IProcessor>();
	private String session;
	private static Hashtable<String, InternalDataManager> manager = new Hashtable<String, InternalDataManager>();

	public InternalDataManager(String sessionId) {
		this.session = sessionId;
	}

	public static InternalDataManager getInstance(String sessionId){
		if (manager.get(sessionId) == null){
			manager.put(sessionId, new InternalDataManager(sessionId) );
		}
		
		return manager.get(sessionId);
	}

	public int size() {
		return internalProcessorCollection.size();
	}

	public Enumeration<Integer> keys() {
		return internalProcessorCollection.keys();
	}

	public boolean contains(IProcessor value) {
		return internalProcessorCollection.contains(value);
	}

	public boolean containsKey(Integer key) {
		return internalProcessorCollection.containsKey(key);
	}

	public IProcessor get(Integer key) {
		return internalProcessorCollection.get(key);
	}

	public IProcessor put(Integer key, IProcessor value) {
		return internalProcessorCollection.put(key, value);
	}

	public void clear() {
		internalProcessorCollection.clear();
	}

	public Collection<IProcessor> values() {
		return internalProcessorCollection.values();
	}
	

	
	
}
